CREATE TABLE [dbo].[TTCANP_ANUL]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[CO_PROV] [dbo].[TD_VC_020] NOT NULL,
[NU_CANJ] [dbo].[TD_VC_008] NOT NULL,
[FE_CANJ] [dbo].[TD_DT_001] NOT NULL,
[FE_ANUL] [dbo].[TD_DT_001] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TTCANP_AN__ST_CO__46DD686B] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTCANP_AN__NU_PR__48C5B0DD] DEFAULT ((0)),
[NU_ASTO] [dbo].[TD_VC_010] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTCANP_AN__CO_US__49B9D516] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTCANP_AN__FE_US__4AADF94F] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTCANP_AN__CO_US__4BA21D88] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTCANP_AN__FE_US__4C9641C1] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTCANP_ANUL] WITH NOCHECK ADD CONSTRAINT [CK__TTCANP_AN__ST_CO__47D18CA4] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TTCANP_ANUL] ADD CONSTRAINT [PK__TTCANP_A__77CB013975A3444C] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [CO_PROV], [NU_CANJ], [FE_CANJ]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTCANP_ANUL] ADD CONSTRAINT [FK__TTCANP_ANUL__470850F4] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
ALTER TABLE [dbo].[TTCANP_ANUL] ADD CONSTRAINT [FK__TTCANP_ANUL__46142CBB] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [CO_PROV], [NU_CANJ], [FE_CANJ]) REFERENCES [dbo].[TCCANJ_PROV] ([CO_EMPR], [CO_UNID_CONC], [CO_PROV], [NU_CANJ], [FE_CANJ])
GO
